﻿Public Class ButtonCell

    Public Property ButtonSize As Point
        Get
            Return btn.Size
        End Get
        Set(ByVal value As Point)
            btn.Size = value
            ButtonCell_SizeChanged(Me, New EventArgs)
        End Set
    End Property

    Public Property ButtonFont As Font
        Get
            Return btn.Font
        End Get
        Set(ByVal value As Font)
            btn.Font = value
        End Set
    End Property

    Private Sub ButtonCell_SizeChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.SizeChanged
        btn.Left = (Me.Width - btn.Width) / 2 - 1
        btn.Top = (Me.Height - btn.Height) / 2 - 1
    End Sub

    Protected Overrides Sub OnClick(ByVal e As System.EventArgs)
        Exit Sub
    End Sub

    Private Sub btn_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btn.Click
        MyBase.OnClick(e)
    End Sub
End Class
